load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
load("//tools:defaults.bzl", "ts_library")

package(default_visibility = ["//visibility:public"])

exports_files(
    ["op.template.ts"],
    visibility = ["//visibility:public"],
)

ts_library(
    name = "test_snippets_lib",
    testonly = True,
    srcs = [
        "test_snippets.ts",
    ],
    deps = [
        "//tfjs-converter/src:tfjs-converter_lib",
        "//tfjs-core/scripts/test_snippets:test_snippets_util_lib",
        "//tfjs-core/src:tfjs-core_lib",
        "//tfjs-core/src:tfjs-core_src_lib",
    ],
)

ts_library(
    name = "gen_op_lib",
    srcs = [
        ":gen_op.ts",
    ],
    deps = [
        "@npm//@types/argparse",
        "@npm//@types/node",
        "@npm//argparse",
    ],
)

nodejs_binary(
    name = "gen_op_bin",
    data = [
        ":gen_op_lib",
    ],
    entry_point = "gen_op.ts",
)

ts_library(
    name = "kernels_to_ops_lib",
    srcs = [
        ":kernels_to_ops.ts",
    ],
    deps = [
        "@npm//@types/argparse",
        "@npm//@types/node",
        "@npm//argparse",
        "@npm//ts-morph",
    ],
)

nodejs_binary(
    name = "kernels_to_ops_bin",
    data = [
        ":kernels_to_ops_lib",
    ],
    entry_point = "kernels_to_ops.ts",
)
